import React from 'react';

import {connect} from 'react-redux';
// 导入actions
import {get_slider} from '../redux/actions';

class Slider extends React.Component {
    constructor(props) {
        super(props);
        this.state = {}
    }
    render() {
        const slider = this.props.slider;
        return (
            <div className="container">
                <hr/>
                <div className="row">

                    {slider.map(item => (
                        <div key={item} className="col-xs-6 col-md-3">
                            <a href="#" className="thumbnail">
                                <img src={item} alt={item} />
                            </a>
                        </div>
                    ))}

                </div>
            </div>

        )
    }
} 

const mapStateToProps=(state)=>({slider:state.slider});
const mapActionToProps={get_slider}
export default connect(mapStateToProps,mapActionToProps)(Slider)